function getUser()
{
    const email=document.querySelector('#email').value
    const password=document.querySelector('#password').value

    axios({
        url:'http://47.120.4.197:8082/signIn/login',
        method:'POST',
        data:{
            email,
            password
        }
    }).then(result => {
      // 登录成功，获取token
      // console.log(result);
      const code = result.data.code;
      if (code === 1) {
        const token = result.data.data.token;
        // 设置axios请求头
        axios.defaults.headers.common['Authorization'] = `Bearer ${token}`;
        // 将token存储到本地存储中（这里使用localStorage）
        localStorage.setItem('token', token);
  
        // console.log('登录成功，token已设置到请求头并存储到本地！');
        location.href = '../../userWeb/index.html';
      } else {
        displayMessage(result.data.msg || '登录失败，请重试');
      }
    })
      .catch(error => {
        console.error('请求失败：', error);
      });
}
function displayMessage(message) {
  const messageBox = document.getElementById('message-box');
  messageBox.innerText = message;
  messageBox.style.backgroundColor='rgba(197, 43, 43,0.3)'
  // 显示消息框并在3秒后隐藏
  messageBox.style.display = 'block';
  setTimeout(() => {
      messageBox.style.display = 'none';
      messageBox.style.backgroundColor=''
  }, 2000);
}